package com.droid.lib.controls.demo.view;

import android.content.Context;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.droid.lib.controls.demo.R;
import com.droid.lib.controls.demo.activity.MainActivity;

/**
 * Created by Administrator on 2016/9/29.
 */
public class SnackBarFragment extends Fragment{
    private Button button3;
    private Context mContext;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mContext = getActivity();
        final View view = inflater.inflate(R.layout.fragment_snack_bar, null);
        button3 = (Button) view.findViewById(R.id.button3);
        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Snackbar.make(view,"Snackbar",Snackbar.LENGTH_SHORT).show();
            }
        });

        if(mContext != null){
            ((MainActivity)mContext).getmResideMenu().addIgnoredView(view);
        }
        return view;
    }
}
